{% load forum_tags %}
{% load static %}

{% block headimg %}
    <div class="header item" id="logo">
        <a href="/"><img class="ui image" width="220px" src="{% static "images/logo6.svg" %}"></a>
    </div>
{% endblock %}

<div class="ui labeled icon attached fluid pointing menu" id="menu-header">

    <div class="ui left simple dropdown item">

        <i class="bars icon"><i class="dropdown icon"></i></i>
        <div class="menu">
            <a class="item {% activate tab "new" %}" href="{% url 'post_create' %}">
                <i class=" edit icon"></i>New Post
            </a>

            <a class="item {% activate tab "latest" %} " href="{% url 'post_list' %}">
                <i class=" list icon"></i> Latest
            </a>
            <a class="item {% activate tab "open" %} " href="{% url 'post_topic' 'open' %}">
                <i class="envelope open icon"></i> Open
            </a>
            <a class="item  {% activate tab "news" %} " href="{% url 'post_topic' 'news' %}">
                <i class=" newspaper icon"></i> News
            </a>
            <a class="item {% activate tab "jobs" %} " href="{% url 'post_topic' 'jobs' %}">
                <i class=" briefcase icon"></i> Jobs
            </a>

            <a class="item {% activate tab "tutorial" %} " href="{% url 'post_topic' 'tutorials' %}">
                <i class=" info circle icon"></i> Tutorials
            </a>
            <a class="item {% activate tab "forum" %} " href="{% url 'post_topic' 'forum' %}">
                <i class="file icon"></i> Forum
            </a>

            <a class="item {% activate tab "tags" %} " href="{% url 'tags_list' %}">
                <i class="tag icon"></i>Tags
            </a>
            <a class="item {% activate tab "planet" %} " href="{% url 'blog_list' %}">
                <i class="rss icon"></i> Planet
            </a>
            <a class="item {% activate tab "community" %}" href="{% url 'community_list' %}">
                <i class=" world icon"></i>
                Users
            </a>
        </div>

    </div>


    <div class="ui right simple dropdown  item">
        {% if request.user.is_authenticated %}
            <i class="plus icon"><i class="dropdown icon"></i></i>
            <div class=" menu">
                <a class="item  {% activate tab "messages" %}" href="{% url 'inbox' %}">
                    {% if counts.message_count %}
                        <div class="ui green button"><i class="envelope icon"></i>Messages {{ counts.message_count }}
                        </div>
                    {% else %}
                        <i class="envelope icon"></i>Messages
                    {% endif %}
                </a>
                <a class="item {% activate tab "myvotes" %}" href="{% url 'myvotes' %}">
                    {% if counts.vote_count %}
                        <div class="ui pink button"><i class="heart icon"></i> Votes {{ counts.vote_count }}</div>
                    {% else %}
                        <i class="heart icon"></i> Votes
                    {% endif %}

                </a>

                <a class="item {% activate tab "myposts" %}" href="{% url 'myposts' %}">
                    <i class="comments icon"></i>My Posts
                </a>
                <a class="item {% activate tab "mytags" %}" href="{% url 'mytags' %}">
                    <i class="tags icon"></i> My Tags
                </a>
                <a class="item {% activate tab "following" %}" href="{% url 'following' %}">
                    <i class="bell icon"></i> Following
                </a>

                <a class="item  {% activate tab "bookmarks" %}" href="{% url 'bookmarks' %}">
                    <i class="bookmark icon"></i> Bookmarks
                </a>
            </div>
        {% endif %}

    </div>

    <div class="ui right simple dropdown item">

        <i class="user icon"><i class="dropdown icon"></i></i>
        <div class="menu" id="login-opts">
            {% if user.is_authenticated %}
                <a class="item  {% activate tab "profile" %}" href="{% url 'user_profile' user.profile.uid %}">
                    <i class="user icon"></i> {{ user.profile.name }}{% user_icon user %}
                </a>
                <a class="item {% activate tab "logout" %}" href="{% url 'logout' %}">
                    <i class="sign-out icon"></i> Logout
                </a>
            {% else %}
                <a class="item {% activate tab "login" %}" href="{% url 'login' %}"><i class="sign-in icon"></i>
                    Log In</a>
                <a class="item {% activate tab "signup" %}" href="{% url 'signup' %}"><i
                        class="arrow circle up icon"></i>
                    Sign Up</a>
            {% endif %}

            <a class="item {% activate tab "about" %}"><i class="info circle icon"></i>About
            </a>
        </div>


    </div>
</div>
